<?php

namespace Narti\BouncerBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class LandlineType extends AbstractType
{
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('bounce')
            ->add('titolo', 'textarea')
            ->add('contenuto', 'textarea')
            ;    
        
        $builder->add('craft', 'entity', array(
                    'class' => 'Narti\\BouncerBundle\\Entity\\Craft',
                    'property' => 'nome',
                    'query_builder' => function(\Narti\BouncerBundle\Repository\CraftRepository $er) {
                        return $er->createQueryBuilder('a')
                        ->orderBy('a.nome', 'ASC');
                    },
                    'required' => true        
                ));
        
    }
}